/**
 * Zhznet.com Inc.
 * Copyright (c) 2004-2012 All Rights Reserved.
 */
package com.ceicei.taobaoke.api.shangpin;

import com.ceicei.util.CeiceiConstants;
import com.taobao.api.ApiException;
import com.taobao.api.DefaultTaobaoClient;
import com.taobao.api.TaobaoClient;
import com.taobao.api.request.ItemsOnsaleGetRequest;
import com.taobao.api.response.ItemsOnsaleGetResponse;

/**
 *
 * @author 李威-liwei2672@gmail.com
 * @version $Id: ItemsOnsaleGetTest.java, v 0.1 2012-4-18 下午04:05:00 李威 Exp $
 */
public class ItemsOnsaleGetTest {

    public static void main(String[] args) {

        try {
            //生成客户端实例   
            TaobaoClient client = new DefaultTaobaoClient(CeiceiConstants.url,
                CeiceiConstants.appkey, CeiceiConstants.appSecret);
            //淘宝卖家的出售的商品列表   
            ItemsOnsaleGetRequest tbReq = new ItemsOnsaleGetRequest();

            tbReq.setFields("iid,title,price,list_time,num");
            tbReq.setPageNo(1L);
            tbReq.setPageSize(20L);
            // use appkey as session_id   
            ItemsOnsaleGetResponse tbRsp = client.execute(tbReq, CeiceiConstants.appkey);//搜索单个商品信息的Request请求   
            //如果接口调用成功   
            if (!tbRsp.isSuccess()) {
                System.out.println(tbRsp);
            }
        } catch (ApiException e) {
            System.out.println(e);
        }
    }
}